package com.bst.bsj.portal.yun.service;

import java.util.Date;

public class FolderItem {

    public String name; 
    public String type; 
    public long   size; 
    public Date   date; 

    public FolderItem(){

    }

    public FolderItem(String data){
        String[] a = data.split("\t");
        if (a.length == 4) {
            this.name = a[0];
            this.type = (a[1].equals("N") ? "File" : "Folder");
            try {
                this.size = Long.parseLong(a[2].trim());
            } catch (NumberFormatException e) {
                this.size = -1;
            }
            long da = 0;
            try {
                da = Long.parseLong(a[3].trim());
            } catch (NumberFormatException e) {
            }
            this.date = new Date(da * 1000);
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

}
